package com.gaeainfo.modules.mobile.service;

import com.gaeainfo.framework.core.utils.common.GaeaCommonUtil;
import com.gaeainfo.modules.mobile.dao.MobileDao;
import com.gaeainfo.modules.mobile.entity.MobileStatusEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;

/**
 * Created by Caven on 2018/7/19.
 */
@Service("mobileService")
public class MobileServiceImpl implements MobileService {

    @Autowired
    private MobileDao mobileDao;

    @Override
    public void createMobileStatus(String deptId, String policeNo, String policeName, String status) throws Exception {
        MobileStatusEntity mobileStatusEntity = new MobileStatusEntity();
        mobileStatusEntity.setPid(GaeaCommonUtil.generateUUID(""));
        mobileStatusEntity.setDeptId(deptId);
        mobileStatusEntity.setPoliceNo(policeNo);
        mobileStatusEntity.setPoliceName(policeName);
        mobileStatusEntity.setStatus(status);
        mobileStatusEntity.setCreatedTime(new Timestamp(System.currentTimeMillis()));
        mobileDao.createMobileStatus(mobileStatusEntity);
    }
}
